#ifndef _DECODER_PARAM_H
#define _DECODER_PARAM_H

#ifdef __cplusplus
extern "C" {
#endif

#include "od_param.h"
#include "param_json.h"
#include "param_save.h"
#include "rpc_response.h"
#include "json_rpc.h"
#include "od_framework.h"
#include "zlst.h"
#include "usecase_decoder.h"

#define OD_MAX_OBJ_NAME           32
#define OD_MAX_PATH_LEN           256


typedef struct decoder_vid_recv_params
{
    struct znode cvfl;           /**< const common variable for list */
    int ctrl;                    /**< 0:close 1:open*/
    int vid_port;                /**< video receive port*/
    int vid_pt;                  /**< video rtp payload type*/
    int vid_lost_rate;           /**< read only*/
    int recv_cast_mode;
    char recv_multi_addr[32];  
}decoder_vid_recv_params;


typedef  struct decoder_vid_dec_params
{
    int codec_type;  /**< see #PAYLOAD_TYPE_E*/
    int vo_mode;     /**< video output display mode, see #SAMPLE_VO_MODE_E*/
    int vo_format;   /**< video interface sync mode, see #VO_INTF_SYNC_E*/
}decoder_vid_dec_params;


typedef struct decoder_params 
{
    decoder_vid_recv_params recv[DECODER_MAX_CHN];
    decoder_vid_dec_params vdec;
    
    int exit; /*线程结束*/
    int done; /*结束标志，隐藏参数*/
    
    char version[OD_MAX_OBJ_NAME]; /*版本号*/
    char date[OD_MAX_OBJ_NAME];   /*编译日期*/
}decoder_params;


typedef struct decoder_params_obj{
    /*参数结构体*/
    decoder_params  dec_params;

    /*用户参数描述*/
    jsparam_hdl decoder_json_hdl;
    struct json_object *decoder_json_obj;
    char decoder_json_filename[OD_MAX_PATH_LEN];

    param_save_handle h_param_save;
    rpc_response_task_handle h_rpc_response;

    /*private data*/
    void *private;
}decoder_params_obj;

typedef void *decoder_params_handle;

int decoder_params_init(od_framework_t *frameworks, char *filename);
void decoder_params_destroy(decoder_params_handle handle);

#ifdef __cplusplus
}
#endif

#endif

/*_*/


